package org.dataframework.security.core;

/**
 * @Author: LiuCf
 * @Email: 1316640406@qq.com
 * @Date: 2021/7/3 11:52
 */
public enum Operators {
    HIDDEN("隐藏", 0, true),
    FOREIGN_KEY("引用"),
    EQUALS("等于"),
    NOT_EQUALS("不等于"),
    GREATER_THAN("大于"),
    MINOR_THAN("小于"),
    GREATER_EQUALS("大于等于"),
    MINOR_EQUALS("小于等于"),
    IS_NULL("为空", 0),
    IS_NOT_NULL("不为空", 0),
    FULL_LIKE("全匹配"),
    NOT_LIKE("不匹配"),
    IN("包含"),
    NOT_IN("不包含"),
    BETWEEN("之间", 2),
    CUSTOMIZE("自定义", 0)
    ;

    private String operator;

    private Integer requireInput;

    private boolean exclusive;

    Operators(String operator) {
        this.operator = operator;
        this.requireInput = 1;
        this.exclusive = false;
    }

    Operators(String operator, Integer requireInput) {
        this.operator = operator;
        this.requireInput = requireInput;
        this.exclusive = false;
    }

    Operators(String operator, Integer requireInput, boolean exclusive) {
        this.operator = operator;
        this.requireInput = requireInput;
        this.exclusive = exclusive;
    }

    public String getOperator() {
        return operator;
    }

    public Integer getRequireInput() {
        return requireInput;
    }

    public boolean isExclusive() {
        return exclusive;
    }

    public static void main(String[] args) {
        for (int i = 0; i < Operators.values().length; i++) {
            System.out.println("case \"" + Operators.values()[i].name() + "\": \n return ;\n");
        }
    }
}
